package ldh.im.util;

public class RandomCharacter {

    public static char getRandomCharacter(char ch1, char ch2) {
        return (char)(ch1 + Math.random() * (ch2 - ch1 + 1));
    }

    public static char getRandomLowerCaseLetter() {
        return getRandomCharacter('a', 'z');
    }

    public static char getRadomDigitCharcter() {
        return getRandomCharacter('0', '9');
    }

    public static char getRandomCharacter() {
        return getRandomCharacter('\u0000', '\uFFFF');
    }

    public static String getRandomCharacter(int integer) {
        String result = "";
        for(int i=0; i< integer; i++) {
            result += getRandomLowerCaseLetter();
        }
        return result;

    }
}
